3.70 \(\int (a+b \sin ^2(c+d x)) \, dx\)

Optimal. Leaf size=30 \[ a x-\frac{b \sin (c+d x) \cos (c+d x)}{2 d}+\frac{b x}{2} \]

[Out]

a*x + (b*x)/2 - (b*Cos[c + d*x]*Sin[c + d*x])/(2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0148417, antiderivative size = 30, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {2635, 8} \[ a x-\frac{b \sin (c+d x) \cos (c+d x)}{2 d}+\frac{b x}{2} \]

Antiderivative was successfully verified.

[In]

Int[a + b*Sin[c + d*x]^2,x]

[Out]

a*x + (b*x)/2 - (b*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \left (a+b \sin ^2(c+d x)\right ) \, dx &=a x+b \int \sin ^2(c+d x) \, dx\\ &=a x-\frac{b \cos (c+d x) \sin (c+d x)}{2 d}+\frac{1}{2} b \int 1 \, dx\\ &=a x+\frac{b x}{2}-\frac{b \cos (c+d x) \sin (c+d x)}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.0282181, size = 33, normalized size = 1.1 \[ a x+\frac{b (c+d x)}{2 d}-\frac{b \sin (2 (c+d x))}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[a + b*Sin[c + d*x]^2,x]

[Out]

a*x + (b*(c + d*x))/(2*d) - (b*Sin[2*(c + d*x)])/(4*d)

________________________________________________________________________________________

Maple [A]  time = 0.022, size = 32, normalized size = 1.1 \begin{align*} ax+{\frac{b}{d} \left ( -{\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+sin(d*x+c)^2*b,x)

[Out]

a*x+b/d*(-1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)

________________________________________________________________________________________

Maxima [A]  time = 0.944351, size = 39, normalized size = 1.3 \begin{align*} a x + \frac{{\left (2 \, d x + 2 \, c - \sin \left (2 \, d x + 2 \, c\right )\right )} b}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(d*x+c)^2,x, algorithm="maxima")

[Out]

a*x + 1/4*(2*d*x + 2*c - sin(2*d*x + 2*c))*b/d

________________________________________________________________________________________

Fricas [A]  time = 1.57504, size = 72, normalized size = 2.4 \begin{align*} \frac{{\left (2 \, a + b\right )} d x - b \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(d*x+c)^2,x, algorithm="fricas")

[Out]

1/2*((2*a + b)*d*x - b*cos(d*x + c)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 0.429219, size = 51, normalized size = 1.7 \begin{align*} a x + b \left (\begin{cases} \frac{x \sin ^{2}{\left (c + d x \right )}}{2} + \frac{x \cos ^{2}{\left (c + d x \right )}}{2} - \frac{\sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\x \sin ^{2}{\left (c \right )} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(d*x+c)**2,x)

[Out]

a*x + b*Piecewise((x*sin(c + d*x)**2/2 + x*cos(c + d*x)**2/2 - sin(c + d*x)*cos(c + d*x)/(2*d), Ne(d, 0)), (x*
sin(c)**2, True))

________________________________________________________________________________________

Giac [A]  time = 1.12648, size = 34, normalized size = 1.13 \begin{align*} \frac{1}{4} \, b{\left (2 \, x - \frac{\sin \left (2 \, d x + 2 \, c\right )}{d}\right )} + a x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(d*x+c)^2,x, algorithm="giac")

[Out]

1/4*b*(2*x - sin(2*d*x + 2*c)/d) + a*x